<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/31 0031
 * Time: 下午 3:45
 */

namespace app\sports_admin\model;


use think\Model;
use traits\model\SoftDelete;

class Watch_700c extends Model
{
    use SoftDelete;
    protected $table = 'watch_700c';

    protected $autoWriteTimestamp = true;

    protected $pk = 'id';

    /**
     * 首页列表
     * @param $info 分页，排序，检索信息
     */
    public static function infoList($info)
    {
        $rows = self::where(function ($query)use($info){
                if($info['number']){
                    $query->where('number','like',"%{$info['number']}%");
                }
            })->order($info['sort'],$info['sortOrder'])->page($info['page'])->limit($info['rows'])->select();
        $count = self::where(function ($query)use($info){
                if($info['number']){
                    $query->where('number','like',"%{$info['number']}%");
                }
            })->count();
        return ['rows'=>$rows,'total'=>$count];
    }
}